<template>
  <el-container class="conclusion-form">
    <el-header height="40px" class="header">
	    <el-row type="flex" justify="space-between">
	      <span class="title">项目结题</span>
	      <div>
	      	<el-button v-show="conclusionRecord.xmjtbh && conclusionRecord.xmjtbh!='' "
          type="success" size="mini" icon="el-icon-check" @click="onSaveClick">保存</el-button>
	      	<el-button type="warning" size="mini" icon="el-icon-close" @click="onCloseClick">关闭</el-button>
	      </div>
	    </el-row>
	  </el-header>
    <el-main class="main">
      <el-container style="height:100%;" v-if="!conclusionRecord.xmjtbh || conclusionRecord.xmjtbh=='' ">
        <el-header height="40px">
          <h3>请<span style="color:red;">选择</span>一个正在建设的项目来结题</h3>
        </el-header>
        <el-main>
          <simple-panel :panelTitle="'建设中的项目'">
            <template slot="main">
              <el-table :data="constructionData" stripe border size="medium" style="width: 100%;height:100%"
              highlight-current-row @current-change="onConstructionChange">
                <template v-for="(col, index) in constructionColumns">
                  <el-table-column :key="index" v-if="!col.hidden" :prop="col.prop" :label="col.label" :width="col.width"
                  :align="col.align?col.align:'left'" :header-align="col.headerAlign?col.headerAlign:'left'">
                    <template slot-scope="scope">
                      <span v-if="col.renderer" v-html="col.renderer(scope,col.prop)">
                      </span>
                      <span v-else v-text="scope.row[col.prop]">
                      </span>
                    </template>
                  </el-table-column>
                </template>
              </el-table>
            </template>
          </simple-panel>
          <el-form style="margin-top:5px;" ref="introductionForm" :model="conclusionRecord" :rules="conclusionRules"
          label-position="right" label-width="150px" size="mini" status-icon>
            <el-row>
              <el-col :offset="5" :span="12">
                <el-row>
                  <el-col :span="12">
                    <el-form-item label="项目级别" prop="xmjb">
                      <el-input v-model="conclusionRecord.xmjb" readonly></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="项目类别" prop="xmlx">
                      <el-input v-model="conclusionRecord.xmlx" readonly></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-form-item label="项目名称" prop="xmmc">
                  <el-input v-model="conclusionRecord.xmmc" readonly></el-input>
                </el-form-item>
                <el-row>
                  <el-col :span="12">
                    <el-form-item label="项目负责人" prop="xm">
                      <el-input v-model="conclusionRecord.xm" readonly></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="职称" prop="zc">
                      <el-input v-model="conclusionRecord.zc" readonly></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-form-item label="联系电话" prop="sj">
                  <el-input v-model="conclusionRecord.sj" readonly></el-input>
                </el-form-item>
                <el-form-item label="项目所在部门" prop="xymc">
                  <el-input v-model="conclusionRecord.xymc" readonly></el-input>
                </el-form-item>
                <el-row>
                  <el-col :span="12"> 
                    <el-form-item label="立项时间" prop="lxsj">
                      <el-date-picker style="width:100%;" v-model="conclusionRecord.lxsj" type="date" 
                      format="yyyy年MM月" value-format="timestamp">
                      </el-date-picker>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="完成时间" prop="jxsj">
                      <el-date-picker style="width:100%;" v-model="conclusionRecord.jxsj" type="date" 
                      format="yyyy年MM月" value-format="timestamp">
                      </el-date-picker>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-form-item label="建设经费">
                  <el-input v-model="jfhj" readonly></el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
        </el-main>
        <el-footer>
          <el-button @click="onIntroductionConfirm" type="primary" size="mini">确定</el-button>
          <el-button @click="onCloseClick" size="mini">取消</el-button>
        </el-footer>
      </el-container>
      <el-tabs style="height:98%;" v-else v-model="activePage">
        <!-- 基本情况 -->
        <el-tab-pane label="基本情况" name="basic">
          <simple-panel :panelTitle="'项目简况'">
            <template slot="main">
              <el-form class="basic-form" ref="basicForm" :model="conclusionRecord" :rules="conclusionRules"
              label-position="right" label-width="150px" size="mini" status-icon>
                <el-row>
                  <el-col :span="8">
                    <el-form-item label="项目名称：" prop="xmmc">
                      <el-input v-model="conclusionRecord.xmmc" readonly></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="8">
                    <el-form-item label="项目类型：" prop="xmlx">
                      <el-input v-model="conclusionRecord.xmlx" readonly></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="8">
                    <el-form-item label="项目级别" prop="xmjb">
                      <el-input v-model="conclusionRecord.xmjb" readonly></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="12">
                    <el-form-item label="立项时间：" prop="lxsj">
                      <el-date-picker style="width:100%;" v-model="conclusionRecord.lxsj" type="date" 
                      format="yyyy年MM月" value-format="timestamp" readonly>
                      </el-date-picker>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="完成时间：" prop="jxsj">
                      <el-date-picker style="width:100%;" v-model="conclusionRecord.jxsj" type="date" 
                      format="yyyy年MM月" value-format="timestamp" readonly>
                      </el-date-picker>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
            </template>
          </simple-panel>
          <simple-panel :panelTitle="'项目负责人'">
            <template slot="main">
              <el-form class="fzr-form" ref="fzrForm" :model="teacherRecord" :rules="teacherRules"
              label-position="right" label-width="150px" size="mini" status-icon>
                <el-row>
                  <el-col :span="8">
                    <el-form-item label="姓名：" prop="xm">
                      <el-input v-model="teacherRecord.xm" readonly></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="8">
                    <el-form-item label="性别：" prop="xb">
                      <el-input v-model="conclusionRecord.xmlx" readonly></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="8">
                    <el-form-item label="出生年月" prop="csny">
                       <el-date-picker style="width:100%;" v-model="conclusionRecord.csny" type="date" 
                       format="yyyy年MM月" value-format="timestamp">
                       </el-date-picker>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="8">
                    <el-form-item label="学位：" prop="xw">
                      <el-input v-model="teacherRecord.xw" readonly></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="8">
                    <el-form-item label="学历：" prop="xl">
                      <el-input v-model="conclusionRecord.xl" readonly></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="8">
                    <el-form-item label="所学专业：" prop="sxzy">
                      <el-input v-model="conclusionRecord.sxzy" readonly></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="8">
                    <el-form-item label="毕业学校：" prop="byxx">
                      <el-input v-model="teacherRecord.byxx" readonly></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="8">
                    <el-form-item label="职称：" prop="zc">
                      <el-input v-model="conclusionRecord.zc" readonly></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="8">
                    <el-form-item label="职务：" prop="zw">
                      <el-input v-model="conclusionRecord.zw" readonly></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="8">
                    <el-form-item label="E-mail：" prop="email">
                      <el-input v-model="teacherRecord.email" readonly></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="8">
                    <el-form-item label="办公电话：" prop="bgdh">
                      <el-input v-model="conclusionRecord.bgdh" readonly></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="8">
                    <el-form-item label="手机：" prop="sj">
                      <el-input v-model="conclusionRecord.sj" readonly></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
            </template>
          </simple-panel>
          <!-- 项目成员 -->
          <simple-panel :panelTitle="'项目主要成员'">
            <template slot="main">
              <el-table :data="memberData" stripe border size="medium" style="width: 100%;height:100%"
              highlight-current-row>
                <template v-for="(col, index) in memberColumns">
                  <el-table-column :key="index" v-if="!col.hidden" :prop="col.prop" :label="col.label" :width="col.width"
                  :align="col.align?col.align:'left'" :header-align="col.headerAlign?col.headerAlign:'left'">
                    <template slot-scope="scope">
                      <span v-if="col.renderer" v-html="col.renderer(scope,col.prop)">
                      </span>
                      <span v-else v-text="scope.row[col.prop]">
                      </span>
                    </template>
                  </el-table-column>
                </template>
              </el-table>
            </template>
          </simple-panel>
        </el-tab-pane> 
        <!-- 成果简介 -->
        <el-tab-pane label="成果简介" name="resultSummary">
          <el-form ref="resultSummaryForm" :model="conclusionRecord" :rules="conclusionRules"
            label-position="top" size="mini" status-icon>
              <el-form-item label="成果简介:" prop="cgjj">
                <el-input type="textarea" v-model="conclusionRecord.cgjj" :autosize="{minRows: 3, maxRows: 1000}"></el-input>
              </el-form-item>
            </el-form>
        </el-tab-pane> 
        <!-- 成果清单 -->
        <el-tab-pane label="成果清单" name="resultList">
          <simple-panel :panelTitle="'成果清单'">
            <template slot="main">
              <dynamic-table :tableData="resultData" :columns="resultColumns" :islalCheck="true" buttonPosition="bottomLeft"
              addBtnText="添加成果" delBtnText="删除" :showInsBtn="false" delBtnClsType="danger">
              </dynamic-table> 
            </template>
          </simple-panel>
        </el-tab-pane> 
        <!-- 结题材料清单 -->
        <el-tab-pane label="结题材料清单" name="conclusionList">
          <simple-panel :panelTitle="'结题材料清单'">
            <template slot="main">
              <dynamic-table :tableData="conclusionFileData" :columns="conclusionFileColumns" :islalCheck="true" buttonPosition="bottomLeft"
              addBtnText="添加成果" delBtnText="删除" :showInsBtn="false" delBtnClsType="danger">
              </dynamic-table> 
            </template>
          </simple-panel>
        </el-tab-pane> 
        <!-- 项目经费结算表 -->
        <el-tab-pane label="项目经费结算表" name="projectFundingStatement">
          <simple-panel :panelTitle="'项目经费结算表'">
            <template slot="main">
              <dynamic-table :tableData="budgetData" :columns="budgetColumns" :islalCheck="true" buttonPosition="bottomLeft"
              addBtnText="添加预算条目" delBtnText="删除" :showInsBtn="false" delBtnClsType="danger">
              </dynamic-table> 
            </template>
          </simple-panel>
        </el-tab-pane> 
        <!-- 审核意见 -->
        <el-tab-pane label="审核意见" name="recommendation">
          <simple-panel :panelTitle="'审核意见'">
            <template slot="main">
              <el-form ref="recommendationForm" :model="conclusionRecord" :rules="conclusionRules"
              label-position="top" size="mini" status-icon>
                <el-form-item label="项目所在部门意见：" prop="xmszbmyj">
                  <el-input type="textarea" v-model="conclusionRecord.xmszbmyj" :autosize="{minRows: 3, maxRows: 1000}"></el-input>
                </el-form-item>
                <el-form-item label="项目所在部门日期：" prop="xmszbmrq">
                  <el-date-picker style="width:100%;" v-model="conclusionRecord.xmszbmrq" type="date" value-format="timestamp" placeholder="请选择">
                  </el-date-picker>
                </el-form-item>
                <el-form-item label="专家评审意见：" prop="zjpsyj">
                  <el-input type="textarea" v-model="conclusionRecord.zjpsyj" :autosize="{minRows: 3, maxRows: 1000}"></el-input>
                </el-form-item>
                <el-row>
                  <el-col :span="12">
                    <el-form-item label="专家评审日期：" prop="zjpsrq">
                      <el-date-picker style="width:100%;" v-model="conclusionRecord.zjpsrq" type="date" value-format="timestamp" placeholder="请选择">
                      </el-date-picker>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="专家评审结果：" prop="zjpsjg">
                      <el-select v-model="conclusionRecord.zjpsjg" placeholder="请选择">
                        <el-option
                        v-for="item in zjspjgData" :key="item.zjpsjg" :label="item.zjpsjg" :value="item.zjpsjg">
                        </el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-form-item label="学校审批意见：" prop="xxspyj">
                  <el-input type="textarea" v-model="conclusionRecord.xxspyj" :autosize="{minRows: 3, maxRows: 1000}"></el-input>
                </el-form-item>
                <el-form-item label="学校审批日期：" prop="xxsprq">
                  <el-date-picker style="width:100%;" v-model="conclusionRecord.xxsprq" type="date" value-format="timestamp" placeholder="请选择">
                  </el-date-picker>
                </el-form-item>
              </el-form>
            </template>
          </simple-panel>
        </el-tab-pane> 

      </el-tabs>
    </el-main>
  </el-container>
</template>
<script>
import SimplePanel from "@/components/basic/SimplePanel";
import TablePanel from "@/components/basic/TablePanel";
import DynamicTable from "@/components/basic/DynamicTable";
import {
  formModelInitFromTable,
  formRulesInitFromTable
} from "@/utils/formutils.js";
import { trueFalseRenderer } from "@/utils/tableutils.js";

//meta info

var columnsAttr = "Columns"; // 列
var dataAttr = "Data"; // 数据
var selectionAttr = "Selection"; // 选中
var dlgVisibleAttr = "DlgVisible"; // 对话框
var formAttr = "Form";
var recordAttr = "Record"; // 表单模型
var rulesAttr = "Rules"; // 表单验证


// 项目建设列
var constructionColumns = [
  {
    prop:"xmsbbh",
    label:"项目申报编号",
    outOfSearch:true,
    hidden:true
  },
  {
    prop:"jsbh",
    label:"项目负责人编号",// 就是申报中的项目主持人 
    hidden:true,
    rules:[{
      required:true,
      message:"请选择一个申报过的项目",
      trigger: "blur"
    }]
  },
  {
    prop:"xmmc",
    label:"项目名称"
  },
  {
    prop:"xm",
    label:"项目负责人",
    hidden:true,
    rules:[{
      required:true,
      message:"请选择一个申报过的项目",
      trigger: "change"
    }]
  },
  {
    prop:"zc",
    label:"职称",
    outOfSearch:true,
    hidden:true,
    rules:[{
      required:true,
      message:"请选择一个申报过的项目",
      trigger: "change"
    }]
  },
  {
    prop:"sj",
    label:"联系电话",
    outOfSearch:true,
    hidden:true,
    rules:[{
      required:true,
      message:"请选择一个申报过的项目",
      trigger: "change"
    }]
  },
  {
    prop: "xybh",
    label: "项目所在部门编号",
    outOfSearch:true,
    hidden:true,
    rules:[{
      required:true,
      message:"请选择一个申报过的项目",
      trigger: "change"
    }]
  },
  {
    prop: "xymc",
    label: "项目所在部门",
    rules:[{
      required:true,
      message:"请选择一个申报过的项目",
      trigger: "change"
    }]
  },
  {
    prop:"jsrwbh",
    label:"建设任务编号",
    outOfSearch:true,
    hidden:true
  },
  {
    prop:"xmjb",
    label:"项目级别",
    rules: [{
      required: true,
      message: "必填", 
      trigger: "blur"
    }]
  },
  {
    prop:"xmbh",
    label:"项目编号",// 生成的字段
    rules:[{
      required: true,
      message: "必填",
      trigger: "blur"
    }]
  },
  {
    prop:"lxsj",
    label:"立项时间",
    type:"date",
    rules:[{
      required: true,
      message: "请选择",
      trigger: "blur"
    }]
  },
  {
    prop:"jxsj",
    label:"结项时间",
    type:"date",
    rules:[{
      required: true,
      message: "请选择",
      trigger: "blur"
    }]
  },
  {
    prop:"xmsj",
    label:"项目时间",// 辅助字段
    type:"daterange",
    outOfSearch:true,
    hidden:true,
    rules:[{
      required: true,
      message: "请选择项目时间",
      trigger: "blur"
    }]

  },
  {
    prop:"tbrq",
    label:"填报日期",
    type:"date",
    hidden:true,
    rules:[{
      required: true,
      message: "请选择",
      trigger: "blur"
    }]
  },
  {
    prop:"jsmb",
    label:"建设目标",
    hidden:true,
    rules:[{
      required: true,
      max: 5000, 
      message: "必填，不超过5000个字符",
      trigger: "blur"
    }]
  },
  {
    prop:"jdap",
    label:"进度安排",
    hidden:true,
    rules:[{
      required: true,
      max: 5000, 
      message: "必填，不超过5000个字符",
      trigger: "blur"
    }]
  },
  {
    prop:"yqcgycx",
    label:"预期成果与成效",
    hidden:true,
    rules:[{
      required: true,
      max: 5000, 
      message: "必填，不超过5000个字符",
      trigger: "blur"
    }]
  },
  {
    prop:"bztjyzc",
    label:"保障条件与政策",
    hidden:true,
    rules:[{
      required: true,
      max: 300, 
      message: "必填，不超过300个字符",
      trigger: "blur"
    }]
  },
  {
    prop:"zrrcnnr",
    label:"责任人承诺内容",
    hidden:true,
    rules:[{
      required: true,
      max: 200, 
      message: "必填，不超过200个字符",
      trigger: "blur"
    }]
  },
  {
    prop:"zrrcnshrq",
    label:"责任人承诺审核日期",
    hidden:true,
    type:"date",
    rules:[{
      required: true,
      message: "必填",
      trigger: "blur"
    }]
  },
  {
    prop:"xmszbmshyj",
    label:"项目所在部门审核意见",
    hidden:true
  },
  {
    prop:"xmszbmshrq",
    label:"项目所在部门审核日期",
    hidden:true,
    type:"date",
    rules:[{
      required: true,
      message: "必填",
      trigger: "blur"
    }]
  },
  {
    prop:"xxglbmshyj",
    label:"学校管理部门审核意见",
    hidden:true,
    rules:[{
      required: true,
      message: "必填",
      trigger: "blur"
    }]
  },
  {
    prop:"xxglbmshrq",
    label:"学校管理部门审核日期",
    hidden:true,
    type:"date",
    rules:[{
      required: true,
      message: "必填",
      trigger: "blur"
    }]
  },
  {
    prop:"jsrwzt",
    label:"建设任务状态",
    hidden:true,
  },
  {
    prop:"xmjssurl",
    label:"项目建设书URL",
    hidden:true,
  },
  {
    prop: "sjbmzz",
    label: "上级部门资助",
    type:"number",
    hidden:true,
    rules:[{
      required: true,
      message: "必填，请输入合法的金额",
      pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
      trigger: "blur"
    }]
  },
  {
    prop: "xxzz",
    label: "学校资助",
    type:"number",
    hidden:true,
    rules:[{
      required: true,
      message: "必填，请输入合法的金额",
      pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
      trigger: "blur"
    }]
  },
  {
    prop: "yxpt",
    label: "院系配套",
    type:"number",
    hidden:true,
    rules:[{
      required: true,
      message: "必填，请输入合法的金额",
      pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
      trigger: "blur"
    }]
  },
  {
    prop: "zcjf",
    label: "自筹经费",
    type:"number",
    hidden:true,
    rules:[{
      required: true,
      message: "必填，请输入合法的金额",
      pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
      trigger: "blur"
    }]
  },
  {
    prop: "qtjf",
    label: "其他经费",
    type:"number",
    hidden:true,
    rules:[{
      required: true,
      message: "必填，请输入合法的金额",
      pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
      trigger: "blur"
    }]
  },
];

// 项目成员列
var memberColumns = [
  {
    prop: "xmzcybh",
    label: "项目组成员编号",
    hidden: true
  },
  {
    prop: "cyxh",
    label: "成员序号",// TODO 需要处理自增
    width:80,
    type:"myIndex"
  },
  {
    prop: "jsbh",
    label: "教师",
    type:"select",
    valueKey:"gh",
    labelKey:"xm",
    filterable:true,
    options:[],
    aboutColumns:{
      "gh":"gh",
      "csrqstr":"csrq",
      "zw":"zw",
      "xmc":"xmc",
      "xymc":"xymc"
    }
  }, 
  {
    prop: "gh",
    label: "工号"
  },
  {
    prop: "csrq",
    label: "出生日期",
    type:'date',
    hidden:true
  },
  {
    prop: "csrqstr",
    label: "出生日期"
  },
  {
    prop: "zw",
    label: "专业技术职务"
  }, 
  {
    prop: "xmc",
    label: "系名称"
  }, 
  {
    prop: "xymc",
    label: "学院名称"
  },
  {
    prop: "xmfg",
    label: "项目分工",
    type:"textarea",
    rules: [
      {
        required: true,
        message: "必填",
        trigger: "blur"
      }
    ]
  }
];

// 成果列
var resultColumns = [
  {
    prop:"xh",
    label:"序号",
    type:"myIndex"
  },
  {
    prop:"cgmc",
    label:"成果名称",
    type:"input"
  },
  {
    prop:"wcsj",
    label:"完成时间",
    type:"date"
  }
];

// 结题材料列
var conclusionFileColumns = [
  {
    prop:"xh",
    label:"序号",
    type:"myIndex"
  },
  {
    prop:"clmc",
    label:"材料名称",
    type:"input"
  },
  {
    prop:"fs",
    label:"份数",
    type:"number"
  },
  {
    prop:"bz",
    label:"备注",
    type:"textarea"
  }
];

// 预算支出明细
var budgetColumns =[
  {
    prop:"ysmxbh",
    label:"预算明细编号",
    hidden:true
  },
  {
    prop:"xh",
    label:"序号",
    width:60,
    type:"myIndex"
  },
  {
    prop:"jfzckm",
    label:"经费支出科目",
    width:200,
    type:"input"
  },
  {
    prop:"ytsm",
    label:"用途说明",
    type:"input"
  },
  {
    prop:"je",
    label:"金额",
    width:200,
    type:"number"
  }
];


export default {
  name:"CForm",
  props: {
    formRecord: {
      type: Object
    },
    formRules: {
      type: Object
    }
  },
  components:{
    "simple-panel": SimplePanel,
    "table-panel": TablePanel,
    "dynamic-table": DynamicTable
  },
  computed:{
    jfhj:function(){//经费合计
      var me = this;
      var sjbmzz = parseFloat(me.constructionSelected.sjbmzz);
      var xxzz = parseFloat(me.constructionSelected.xxzz);
      var yxpt   = parseFloat(me.constructionSelected.yxpt);
      var zcjf = parseFloat(me.constructionSelected.zcjf);
      var qtjf = parseFloat(me.constructionSelected.qtjf);

      if(Number.isNaN(sjbmzz+xxzz+yxpt+zcjf+qtjf)){
        return 0;
      }else{
        return sjbmzz+xxzz+yxpt+zcjf+qtjf;
      }
      
    }, 
  },
  methods:{
    onSaveClick:function(){
      console.log("保存！！！");// TODO 这里需要保存一些信息，要理一下
    },
    onCloseClick:function() {// 关闭页面
      this.$emit("form-close");
      //TODO 处理关闭逻辑，主要是清空record和表格内容
    },
    onConstructionChange:function(){

    },
    onIntroductionConfirm:function(){
      var me = this;
      // 验证信息
      var ret;
      me.$refs.introductionForm.validate((result, what)=>{
        ret = result;
      });
      if(!ret){
        me.$message.error("表单信息有误");
        return;
      }
      // 发送请求 提交之后，产生一个xmjtbh /static/data/testSuc.json
      me.getRequest("/static/data/conclusion.json", me.conclusionRecord).then((resp)=>{
        if (resp.status == 200) {
          me.$message.success("提交成功！");
          me.conclusionRecord = resp.data[0]; // 更新保存后的数据
        } else {
          me.$message.error("服务器发生错误，创建项目结题信息失败 ，错误代码：" + resp.status);
        }
      });
    }
  },
  data(){
    return {
      activePage:"basic",
      conclusionRecord: {},
      conclusionRules: {},
      constructionColumns:constructionColumns,// 项目建设列
      constructionData:[],
      constructionSelected:{},
      teacherRecord:{},
      teacherRules:{},
      memberColumns:memberColumns,//
      memberData:[],
      resultColumns:resultColumns,//
      resultData:[],
      conclusionFileColumns:conclusionFileColumns,//
      conclusionFileData:[],
      budgetColumns:budgetColumns,//
      budgetData:[],
      zjspjgData:[]

    }
  },
  created() {
    var me = this;
    me.conclusionRules = me.formRules;// 冒泡进来
    me.conclusionRecord = me.formRecord;// 冒泡进来


    // 专家评审结果
    me.getRequest("/static/data/json/zjpsjg.json").then(resp=>{
      if(resp.status == 200){
        me.zjspjgData = resp.data;
      }
    });

  }
}
</script>
<style lang="scss">
@import "@/assets/scss/basic.scss";

.conclusion-form{
  height: 100%; // 2018-06-11
  margin: 0 5px;

  .header {
    background-color: $--border-level-3;
    text-align: center;
    vertical-align: middle;
    line-height: 40px;

    .title {
      font-size: 20px;
      color: $--color-primary;
    }
  }

  .main {
    height: 100%;
    margin: 0;
    padding: 0;
    
    .el-tabs__header{
      margin-bottom: 0;
    }

    .el-form-item label{
      float: left;
    }

    .basic-form {
      margin-top: 5px;
    }
    
    .fzr-form{
      margin-top: 5px;
    }
  }

}
</style>
